package com.itheima.health.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.SetOperations;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

@Component
public class TrashRemovalUtil {
    @Autowired
    private StringRedisTemplate srt;

    public void add(String url){
        SetOperations<String, String> opsForSet = srt.opsForSet();
        opsForSet.add("allImage", parse(url));
    }

    public static String parse(String url){
        int index = url.lastIndexOf("/");
        return url.substring(index+1);
    }
}
